
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;

namespace Swaf.Config
{	
	/// <summary>
	/// This exception is thrown when something is wrong with the XML format of an application
	/// configuration file.</summary>
	[Serializable]
	public class BadConfigException : BaseException
	{
		public BadConfigException(string message)
			:base(message)
		{
			Application.currentApp.Log.println(Application.NORMAL_STARTUP_LOG_LEVEL,this.ToString());
			// printStackTrace(Cmn.logFile());
		}

		public BadConfigException(string message, Exception innerException) 
			: base(message, innerException)
		{
			Application.currentApp.Log.println(Application.NORMAL_STARTUP_LOG_LEVEL,this.ToString());
		}

		public BadConfigException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
		{
		}

		public BadConfigException(string descriptionOfThing, string expectedThing, string actualThing)
			:base("Wrong XML " + descriptionOfThing + ": expected " + expectedThing + "; found " + actualThing)
		{
			Application.currentApp.Log.println(Application.NORMAL_STARTUP_LOG_LEVEL,this.ToString());
			// printStackTrace(Cmn.logFile());
		}
	}
}